Namespace persistent
    Public Class blackberry_test

        Public Shared Function Test(ByVal msisdn As String) As DataTable
            Dim sql As String
            sql = " select custcode,cslevel,(select custcode from customer_all where customer_id=a.customer_id_high ) from customer_all a where customer_id in "
            sql = sql + " (select customer_id_high from customer_all where customer_id in "
            sql = sql + " (select customer_id_high from customer_all where customer_id= "
            sql = sql + " (select fn_msisdn_to_custid('" & msisdn & "') from dual) "
            sql = sql + " ) and (cslevel='20' or cslevel='30') "
            sql = sql + " ) and (cslevel='10' or cslevel='20') "
            Return myDBConn.myORATable(sql)
        End Function
        Public Shared Function msisdnTOcustcode(ByVal msisdn As String) As DataTable
            Dim sql As String
            sql = " select custcode,cslevel,(select custcode from customer_all where customer_id=a.customer_id_high ) from customer_all a where customer_id in "
            sql = sql + " (select customer_id_high from customer_all where customer_id= "
            sql = sql + " (select fn_msisdn_to_custid('" & msisdn & "') from dual) "
            sql = sql + " ) and (cslevel='20' or cslevel='30') "
            sql = sql + "  and (cslevel='20') "
            Return myDBConn.myORATable(sql)
        End Function
        Public Shared Function msisdnToMassCustcode(ByVal msisdn As String) As DataTable
            Dim strSQL As String

            strSQL = "select cus.custcode from customer_all cus,curr_co_status cur  "
            strSQL += "where cus.customer_id = (select fn_msisdn_to_custid('" & msisdn & "') from dual)  "
            strSQL += " and prgcode in (select prgcode from pricegroup_all "
            strSQL += "	where  prgname not like 'SME%' "
            strSQL += "	and   prgname  not like 'Corporate%' "
            strSQL += "	and prgcode <>32) "
            strSQL += " and cur.CO_ID=(select fn_msisdn_to_coid('" & msisdn & "') from dual) "
            strSQL += " and cur.CH_STATUS='a' "
            Return myDBConn.myORATable(strSQL)
        End Function


        Public Shared Function getContractAll(ByVal custcode As String) As DataTable
            Dim strSQL As String
            strSQL = "SELECT CU.CUSTOMER_ID,NVL(CU.CUSTOMER_ID_HIGH,0),CU.CSLEVEL,CU.CUSTCODE,NVL(FN_CUSTID_TO_MSISDN(CU.CUSTOMER_ID),'-'),CCNAME "
            strSQL = strSQL + "FROM CUSTOMER_ALL CU, CCONTACT_ALL CC "
            strSQL = strSQL + "WHERE CU.CUSTCODE LIKE '" & custcode & "%' "
            strSQL = strSQL + "AND   CC.CCBILL(+)='X' "
            strSQL = strSQL + "AND   CC.CUSTOMER_ID=CU.CUSTOMER_ID "
            strSQL = strSQL + "ORDER BY CUSTCODE,CSLEVEL "
            Return myDBConn.myORATable(strSQL)
        End Function
        Public Shared Function getMsisdnTOCoid(ByVal msisdn As String) As DataTable
            Dim strSQL As String
            strSQL = "SELECT FN_MSISDN_TO_COID('" & msisdn & "') FROM DUAL"
            Return myDBConn.myORATable(strSQL)
        End Function

        Public Shared Function getBB_Packages() As DataTable
            Dim strSQL As String
            strSQL = "SELECT PACK_ID, PACK_DESC FROM BLACKBERRY.BB_PACKAGES "
            strSQL = strSQL + "ORDER BY PACK_ID "
            Return myDBConn.myORATable(strSQL)
        End Function
        Public Shared Function getBB_Model() As DataTable
            Dim strSQL As String
            strSQL = "SELECT MODEL_ID, MODEL_DESC FROM BLACKBERRY.BB_MODEL "
            strSQL = strSQL + "ORDER BY MODEL_ID "
            Return myDBConn.myORATable(strSQL)
        End Function
        Public Shared Function getBB_ModelName(ByVal modelid As Int64) As DataTable
            Dim strSQL As String
            strSQL = "SELECT MODEL_DESC FROM BLACKBERRY.BB_MODEL "
            strSQL = strSQL + " WHERE model_id = " & modelid
            Return myDBConn.myORATable(strSQL)
        End Function

        Public Shared Function getBB_Saf() As DataTable
            Dim strSQL As String
            strSQL = "SELECT SAF_ID, SAF_DESC FROM BLACKBERRY.BB_SAF "
            strSQL = strSQL + "ORDER BY SAF_ID "
            Return myDBConn.myORATable(strSQL)
        End Function

        Public Shared Function getBB_Currency() As DataTable
            Dim strSQL As String
            strSQL = "SELECT CURRENCY_ID,CURRENCY FROM BLACKBERRY.BB_CURRENCY "
            strSQL = strSQL + "ORDER BY CURRENCY_ID  "
            Return myDBConn.myORATable(strSQL)
        End Function

        Public Shared Function getBB_Bundles() As DataTable
            Dim strSQL As String
            strSQL = "SELECT BUND_ID, BUND_DESC FROM BLACKBERRY.BB_BUNDLES "
            strSQL = strSQL + "ORDER BY BUND_ID "
            Return myDBConn.myORATable(strSQL)
        End Function

        Public Shared Function getBB_Groups() As DataTable
            Dim strSQL As String
            strSQL = "SELECT GROUP_ID, GROUP_NUM FROM BLACKBERRY.BB_GROUPS "
            strSQL = strSQL + "ORDER BY GROUP_ID "
            Return myDBConn.myORATable(strSQL)
        End Function

        Public Shared Function getBB_Prices(ByVal model_id As Long, ByVal currency As Long) As DataTable
            Dim strSQL As String
            strSQL = "SELECT PRICE_CODE,PRICE FROM BLACKBERRY.BB_MODEL_PRICE "
            strSQL = strSQL + " WHERE model_id = " & model_id
            strSQL = strSQL + " AND CURRENCY= " & currency
            Return myDBConn.myORATable(strSQL)
        End Function

        Public Shared Function getMaxSeq() As DataTable
            Dim strSQL As String
            strSQL = "SELECT BB_INTERNAL_ID.nextval FROM DUAL "
            Return myDBConn.myORATable(strSQL)
        End Function

        Public Shared Function addCompCharge(ByVal internal_id As Integer, ByVal pack_id As Integer, ByVal bund_id As Integer, ByVal group_id As Integer, ByVal custcode As String, ByVal customer_id As Int64) As Integer
            Dim strSQL As String
            strSQL = "INSERT INTO BLACKBERRY.BB_COMPANY_CHARGE VALUES(" & internal_id & ", "
            strSQL = strSQL + " " & pack_id.ToString & "," & bund_id.ToString & "," & group_id.ToString & ",'" & custcode & "'," & customer_id & "," & "SYSDATE,NULL,NULL) "
            Return myDBConn.ORAExecute(strSQL)
        End Function
        Public Shared Function getCompCharge() As DataTable
            Dim strSQL As String
            strSQL = "SELECT INTERNAL_ID,PACK_ID,BUND_ID,GROUP_ID,CUSTCODE,CUSTOMER_ID,ENTDATE FROM BLACKBERRY.BB_COMPANY_CHARGE"
            Return myDBConn.myORATable(strSQL)
        End Function
        Public Shared Function getPayComp(ByVal custcode As String) As DataTable
            Dim strSQL As String
            strSQL = "SELECT CUSTOMER_ID,CUSTCODE FROM CUSTOMER_ALL "
            strSQL = strSQL + " WHERE CUSTOMER_ID_HIGH IN (SELECT CUSTOMER_ID FROM "
            strSQL = strSQL + " CUSTOMER_ALL WHERE CUSTCODE='" & custcode & "') "
            strSQL = strSQL + " AND PAYMNTRESP='X'"
            Return myDBConn.myORATable(strSQL)
        End Function

        Public Shared Function custcodeToCustomerid(ByVal custcode As String) As DataTable
            Dim strSQL As String
            strSQL = "SELECT CUSTOMER_ID FROM CUSTOMER_ALL WHERE CUSTCODE ='" & custcode & "'"
            Return myDBConn.myORATable(strSQL)
        End Function

        Public Shared Function addCompLine(ByVal internal_id As Integer, ByVal msisdn As Int64) As Integer
            Dim strSQL As String
            strSQL = "INSERT INTO BLACKBERRY.BB_COMPANY_LINES VALUES(" & internal_id & ", "
            strSQL = strSQL + " " & msisdn & "," & "SYSDATE,NULL,NULL) "
            Return myDBConn.ORAExecute(strSQL)
        End Function
        Public Shared Function getCompMsisdn(ByVal custcode As String) As DataTable
            Dim strSQL As String
            strSQL = "SELECT INTERNAL_ID,PACK_ID,BUND_ID,GROUP_ID,CUSTCODE,CUSTOMER_ID,ENTDATE FROM BLACKBERRY.BB_COMPANY_CHARGE"
            strSQL = "SELECT MSISDN FROM BLACKBERRY.BB_COMPANY_CHARGE BC, BLACKBERRY.BB_COMPANY_LINES BL "
            strSQL = strSQL + " WHERE BC.INTERNAL_ID=BL.INTERNAL_ID "
            strSQL = strSQL + " AND   CUSTCODE LIKE '" & custcode & "%' "

            Return myDBConn.myORATable(strSQL)
        End Function
        Public Shared Function custcodeTOmsisdn(ByVal custcode As String) As DataTable
            Dim sql As String
            'sql = "SELECT NVL(BB.BLACKBERRY,'False'),NVL(HANDSET,'False'),CU.CUSTCODE,NVL(FN_CUSTID_TO_MSISDN(CU.CUSTOMER_ID),'-'),CO.CO_ID,NVL(FIRSTMONTHSAF,0),NVL(FIRSTMONTCIHAZ,0),NVL(FIRSTMONTHISKONTO,0),NVL(PROMOTION,0)"
            'sql = sql & " FROM CUSTOMER_ALL CU, CCONTACT_ALL CC,CONTRACT_ALL CO,BB_LINE_CHARGE BB "
            'sql = sql & " WHERE CU.CUSTCODE LIKE '" & custcode & "%' "
            'sql = sql & " AND   CO.CUSTOMER_ID=CU.CUSTOMER_ID"
            'sql = sql & " AND   CO.CO_ID=BB.CO_ID(+)"
            'sql = sql & " AND   CC.CCBILL(+)='X' "
            'sql = sql & " AND   CC.CUSTOMER_ID=CU.CUSTOMER_ID "
            'sql = sql & " AND  NVL(FN_CUSTID_TO_MSISDN(CU.CUSTOMER_ID),'-') != '-'"
            'sql = sql & " ORDER BY CUSTCODE"
            sql = "SELECT "
            sql = sql & " CU.CUSTCODE, "
            sql = sql & " CO.CO_ID, "
            sql = sql & " NVL(FN_CUSTID_TO_MSISDN(CU.CUSTOMER_ID),'-'),"
            sql = sql & " NVL(BB.BLACKBERRY_SERVICE,'False'), "
            sql = sql & " NVL(CHARGE_SAF,'False'), "
            sql = sql & " NVL(CHARGE_SES,'False'), "
            sql = sql & " NVL(CHARGE_CIHAZ,'False'),"
            sql = sql & " NVL(CHARGE_AYLIK_TESIS,'False'),"
            sql = sql & " NVL(PROMOTION,0),"
            sql = sql & " CONTRACT_DATE,"
            sql = sql & " ENTDATE"
            sql = sql & " FROM CUSTOMER_ALL CU, CCONTACT_ALL CC,CONTRACT_ALL CO,BLACKBERRY.BB_LINE_CHARGE2 BB"
            sql = sql & " WHERE CU.CUSTCODE LIKE '" & custcode & "%' "
            sql = sql & " AND   CO.CUSTOMER_ID=CU.CUSTOMER_ID"
            sql = sql & " AND   CO.CO_ID=BB.CO_ID(+)"
            sql = sql & " AND   CC.CCBILL(+)='X' "
            sql = sql & " AND   CC.CUSTOMER_ID=CU.CUSTOMER_ID "
            sql = sql & " AND  NVL(FN_CUSTID_TO_MSISDN(CU.CUSTOMER_ID),'-') != '-'"
            sql = sql & " ORDER BY CUSTCODE"
            Return myDBConn.myORATable(sql)
        End Function
        Public Shared Function addLineBlackBerry2(ByVal parent_cust_code As String, ByVal co_id As Int64, ByVal msisdn As String, ByVal blackberry As String, ByVal saf As String, ByVal ses As String, ByVal cihaz As String, ByVal ayliktesis As String, ByVal promotion As Int64, ByVal contractdate As Date, ByVal entuserid As String) As Integer
            Dim strSQL As String
            strSQL = "INSERT INTO BLACKBERRY.BB_LINE_CHARGE2 VALUES('" & parent_cust_code & "', "
            strSQL = strSQL + " " & co_id & ","
            strSQL = strSQL + " " & msisdn & ","
            strSQL = strSQL + " '" & blackberry & "',"
            strSQL = strSQL + " '" & saf & "',"
            strSQL = strSQL + " '" & ses & "',"
            strSQL = strSQL + " '" & cihaz & "',"
            strSQL = strSQL + " '" & ayliktesis & "',"
            strSQL = strSQL + " " & promotion & ","
            strSQL = strSQL + " '" & contractdate & "',"
            strSQL = strSQL + " SYSDATE,"
            strSQL = strSQL + " null,"
            strSQL = strSQL + " '" & entuserid & "',"
            strSQL = strSQL + " null,"
            strSQL = strSQL + " null,null,null)"
            Return myDBConn.ORAExecute(strSQL)
        End Function

        Public Shared Function getLineCharge(ByVal custcode As String) As DataTable
            Dim strSQL As String
            strSQL = "SELECT PARENT_CUST_CODE,CO_ID,MSISDN,BLACKBERRY_SERVICE,CHARGE_SAF,  CHARGE_SES,CHARGE_CIHAZ,CHARGE_AYLIK_TESIS,PROMOTION,TO_DATE(CONTRACT_DATE,'DD.MM.YYYY'),TO_DATE(ENTDATE,'DD.MM.YYYY') "
            strSQL = strSQL + " FROM BLACKBERRY.BB_LINE_CHARGE2"
            strSQL = strSQL + " WHERE PARENT_CUST_CODE='" & custcode & "'"
            Return myDBConn.myORATable(strSQL)
        End Function
        Public Shared Function getBBLines(ByVal custcode As String) As DataTable
            Dim strSQL As String
            strSQL = "SELECT CO_ID FROM BLACKBERRY.BB_LINE_CHARGE2 WHERE PARENT_CUST_CODE= "
            strSQL = strSQL + "'" & custcode & "'"
            Return myDBConn.myORATable(strSQL)
        End Function
        Public Shared Function modifyBBLines(ByVal blackberry As String, ByVal saf As String, ByVal ses As String, ByVal cihaz As String, ByVal tesis As String, ByVal promotion As Double, ByVal contractdate As Date, ByVal moduserid As String, ByVal co_id As Int64) As Integer
            Dim strSQL As String
            strSQL = "UPDATE BLACKBERRY.BB_LINE_CHARGE2 B"
            strSQL = strSQL + " SET"
            strSQL = strSQL + " BLACKBERRY_SERVICE='" & blackberry & "',"
            strSQL = strSQL + " CHARGE_SAF='" & saf & "',"
            strSQL = strSQL + " CHARGE_SES='" & ses & "',"
            strSQL = strSQL + " CHARGE_CIHAZ='" & cihaz & "',"
            strSQL = strSQL + " CHARGE_AYLIK_TESIS='" & tesis & "',"
            strSQL = strSQL + " MODDATE=SYSDATE, "
            strSQL = strSQL + " PROMOTION='" & promotion & "',"
            strSQL = strSQL + " CONTRACT_DATE='" & contractdate & "',"
            strSQL = strSQL + " MODUSER='" & moduserid & "'"
            strSQL = strSQL + " WHERE CO_ID=" & co_id
            Return myDBConn.ORAExecute(strSQL)
        End Function
        Public Shared Function addCustCharge(ByVal custcode As String, ByVal custid As Int64, ByVal seq As Int64, ByVal model_id As Int16, ByVal currency As Int64, ByVal price_id As Int64, ByVal price As Single, ByVal userid As String, ByVal subid As String) As Integer
            Dim strSQL As String
            If subid = "" Then subid = "null"
            'strSQL = "INSERT INTO BLACKBERRY.BB_CUSTOMER_CHARGE VALUES('" & custcode & "'," & custid & "," & seq & "," & model_id & "," & currency & "," & price_id & ",'" & price & "',SYSDATE,null,null,null," & subid & ",BLACKBERRY.BB_INTERNAL_ID2.NEXTVAL)"
            strSQL = "INSERT INTO BLACKBERRY.BB_CUSTOMER_CHARGE VALUES('" & custcode & "'," & custid & "," & seq & "," & model_id & "," & currency & "," & price_id & ",'" & price & "',SYSDATE,null,null" & ",'" & userid & "'," & subid & ",BLACKBERRY.BB_INTERNAL_ID2.NEXTVAL)"
            Return myDBConn.ORAExecute(strSQL)
        End Function
        Public Shared Function getCompChargeDetail(ByVal custcode As String) As DataTable
            Dim strSQL As String
            'strSQL = "SELECT CUSTCODE,ITEM_SEQUENCE,MODEL_DESC, BC.CURRENCY, BPD.PRICE_DESC, BCC.PRICE,BCC.ENTDATE"
            'strSQL = strSQL + " FROM BB_CUSTOMER_CHARGE BCC, BB_MODEL BM, BB_CURRENCY BC,BB_PRICE_DEF BPD"
            'strSQL = strSQL + " WHERE(BM.MODEL_ID = BCC.MODEL_ID)"
            'strSQL = strSQL + " AND BC.CURRENCY_ID=BCC.CURRENCY"
            'strSQL = strSQL + " AND BPD.PRICE_ID=BCC.PRICE_ID"
            'strSQL = strSQL + " AND CUSTCODE='" & custcode & "'"
            'strSQL = strSQL + " ORDER BY BCC.ENTDATE"

            strSQL = "SELECT CUSTCODE,ITEM_SEQUENCE,MODEL_DESC, BC.CURRENCY, BPD.PRICE_DESC, BCC.PRICE,NULL A,BCC.ENTDATE "
            strSQL = strSQL + " FROM BLACKBERRY.BB_CUSTOMER_CHARGE BCC, BLACKBERRY.BB_MODEL BM, BLACKBERRY.BB_CURRENCY BC,BLACKBERRY.BB_PRICE_DEF BPD"
            strSQL = strSQL + " WHERE(BM.MODEL_ID = BCC.MODEL_ID)"
            strSQL = strSQL + " AND BC.CURRENCY_ID=BCC.CURRENCY"
            strSQL = strSQL + " AND BPD.PRICE_ID=BCC.PRICE_ID"
            strSQL = strSQL + " AND CUSTCODE='" & custcode & "'"
            strSQL = strSQL + " AND BPD.PRICE_ID NOT IN (11,9)"
            strSQL = strSQL + " UNION"
            strSQL = strSQL + " SELECT CUSTCODE,ITEM_SEQUENCE,MODEL_DESC, BC.CURRENCY, BPD.PRICE_DESC, BCC.PRICE,SES.SES_DESC A ,BCC.ENTDATE"
            strSQL = strSQL + " FROM BLACKBERRY.BB_CUSTOMER_CHARGE BCC, BLACKBERRY.BB_MODEL BM, BLACKBERRY.BB_CURRENCY BC,BLACKBERRY.BB_PRICE_DEF BPD,BLACKBERRY.BB_SES SES"
            strSQL = strSQL + " WHERE(BM.MODEL_ID = BCC.MODEL_ID)"
            strSQL = strSQL + " AND BC.CURRENCY_ID=BCC.CURRENCY"
            strSQL = strSQL + " AND BPD.PRICE_ID=BCC.PRICE_ID"
            strSQL = strSQL + " AND CUSTCODE='" & custcode & "'"
            strSQL = strSQL + " AND BPD.PRICE_ID IN (9)"
            strSQL = strSQL + " AND BCC.SUB_ID=SES.SES_ID"
            strSQL = strSQL + " UNION"
            strSQL = strSQL + " SELECT CUSTCODE,ITEM_SEQUENCE,MODEL_DESC, BC.CURRENCY, BPD.PRICE_DESC, BCC.PRICE,SAF.SAF_DESC A ,BCC.ENTDATE"
            strSQL = strSQL + " FROM BLACKBERRY.BB_CUSTOMER_CHARGE BCC, BLACKBERRY.BB_MODEL BM, BLACKBERRY.BB_CURRENCY BC,BLACKBERRY.BB_PRICE_DEF BPD,BLACKBERRY.BB_SAF SAF"
            strSQL = strSQL + " WHERE(BM.MODEL_ID = BCC.MODEL_ID)"
            strSQL = strSQL + " AND BC.CURRENCY_ID=BCC.CURRENCY"
            strSQL = strSQL + " AND BPD.PRICE_ID=BCC.PRICE_ID"
            strSQL = strSQL + " AND CUSTCODE='" & custcode & "'"
            strSQL = strSQL + " AND BPD.PRICE_ID IN (11)"
            strSQL = strSQL + " AND BCC.SUB_ID=SAF.SAF_ID"
            Return myDBConn.myORATable(strSQL)
        End Function
        Public Shared Function getCompChargeMaxSeq(ByVal custcode As String) As DataTable
            Dim strSQL As String
            strSQL = "SELECT NVL(MAX(ITEM_SEQUENCE),0) FROM BLACKBERRY.BB_CUSTOMER_CHARGE "
            strSQL = strSQL + " WHERE CUSTCODE='" & custcode & "'"
            Return myDBConn.myORATable(strSQL)
        End Function
        Public Shared Function checkMsisdn(ByVal custcode As String, ByVal msisdn As String) As DataTable
            Dim sql As String
            sql = "SELECT NVL(FN_CUSTID_TO_MSISDN(CU.CUSTOMER_ID),'-')"
            sql = sql & " FROM CUSTOMER_ALL CU, CCONTACT_ALL CC,CONTRACT_ALL CO"
            sql = sql & " WHERE CU.CUSTCODE LIKE '" & custcode & "%' "
            sql = sql & " AND   CO.CUSTOMER_ID=CU.CUSTOMER_ID"
            sql = sql & " AND   CC.CCBILL(+)='X'"
            sql = sql & " AND   CC.CUSTOMER_ID=CU.CUSTOMER_ID "
            sql = sql & " AND  NVL(FN_CUSTID_TO_MSISDN(CU.CUSTOMER_ID),'-')='" & msisdn & "'"
            sql = sql & " AND  NVL(FN_CUSTID_TO_MSISDN(CU.CUSTOMER_ID),'-') != '-'"
            sql = sql & " ORDER BY CUSTCODE"
            Return myDBConn.myORATable(sql)
        End Function
        Public Shared Function checkMsisdnact(ByVal custcode As String, ByVal msisdn As String) As DataTable
            Dim strSQL As String
            strSQL = "SELECT msisdn FROM BLACKBERRY.BB_LINE_CHARGE2 "
            strSQL = strSQL + "WHERE MSISDN='" & msisdn & "'"
            strSQL = strSQL + " AND PARENT_CUST_CODE='" & custcode & "'"
            Return myDBConn.myORATable(strSQL)
        End Function
        Public Shared Function getCompName(ByVal custcode As String) As DataTable
            Dim strSQL As String
            strSQL = "SELECT CCNAME FROM CCONTACT_ALL WHERE CUSTOMER_ID IN ( "
            strSQL = strSQL + " SELECT CUSTOMER_ID FROM CUSTOMER_ALL "
            strSQL = strSQL + " WHERE custcode = '" & custcode & "')"
            Return myDBConn.myORATable(strSQL)
        End Function
        Public Shared Function getMassName(ByVal custcode As String) As DataTable
            Dim strSQL As String
            strSQL = "SELECT ccfname,cclname FROM CCONTACT_ALL WHERE CUSTOMER_ID IN ( "
            strSQL = strSQL + " SELECT CUSTOMER_ID FROM CUSTOMER_ALL "
            strSQL = strSQL + " WHERE custcode = '" & custcode & "')"
            Return myDBConn.myORATable(strSQL)
        End Function
        Public Shared Function addCustModel(ByVal custcode As String, ByVal model_id As Integer, ByVal currency_id As Integer, ByVal userid As String) As Integer
            Dim strSQL As String
            strSQL = "INSERT INTO BLACKBERRY.BB_CUSTOMER_MODEL_CUR VALUES('" & custcode
            strSQL = strSQL + "'," & model_id
            strSQL = strSQL + "," & currency_id
            strSQL = strSQL + ",sysdate"
            strSQL = strSQL + ",'" & userid & "')"

            Return myDBConn.ORAExecute(strSQL)
        End Function

        Public Shared Function getCustModel(ByVal custcode As String) As DataTable
            Dim strSQL As String
            strSQL = "SELECT CUSTCODE,MODEL_ID,CURRENCY_ID FROM BLACKBERRY.BB_CUSTOMER_MODEL_CUR"
            strSQL = strSQL + " WHERE custcode = '" & custcode & "'"
            Return myDBConn.myORATable(strSQL)
        End Function
        Public Shared Function getCurrCode(ByVal Curr As String) As DataTable
            Dim strSQL As String
            strSQL = "SELECT CURRENCY_ID,CURRENCY FROM BLACKBERRY.BB_CURRENCY"
            strSQL = strSQL + " WHERE CURRENCY='" & Curr & "'"
            Return myDBConn.myORATable(strSQL)
        End Function
        Public Shared Function getSes() As DataTable
            Dim strSQL As String
            strSQL = " SELECT SES_ID,SES_DESC FROM BLACKBERRY.BB_SES"
            Return myDBConn.myORATable(strSQL)
        End Function
        Public Shared Function getSesAmount(ByVal sesid As Integer) As DataTable
            Dim strSQL As String
            strSQL = " SELECT SES_AMOUNT FROM BLACKBERRY.BB_SES "
            strSQL = strSQL + " WHERE SES_ID = '" & sesid & "'"
            Return myDBConn.myORATable(strSQL)
        End Function
        Public Shared Function getSafAmount(ByVal safid As Integer) As DataTable
            Dim strSQL As String
            strSQL = " SELECT SAF_AMOUNT FROM BLACKBERRY.BB_SAF "
            strSQL = strSQL + " WHERE SAF_ID= '" & safid & "'"
            Return myDBConn.myORATable(strSQL)
        End Function
        Public Shared Function checkAmount(ByVal custcode As String, ByVal price_id As Integer) As DataTable
            Dim strSQL As String
            strSQL = " SELECT COUNT(*) FROM BLACKBERRY.BB_CUSTOMER_CHARGE"
            strSQL = strSQL + " WHERE CUSTCODE= '" & custcode & "'"
            strSQL = strSQL + " AND PRICE_ID= '" & price_id & "'"
            Return myDBConn.myORATable(strSQL)
        End Function
    End Class
End Namespace
